/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.qinyeit.serviceapp.entity.enums.SyncStockState;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * ClassName: SyncStock <br/>
 * Function: 库存数据下发 <br/>
 * date: 2018-12-12 15:38:46 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="sync_stocks")
public class SyncStock extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 门店id 
    @Column(name="branch_id")
	private Long branchId = null;

	// 门店名称 
    @Column(name="name", length = 300)
	private String name = null;

	// 上次下发时间 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="last_time")
	private Date lastTime = null;

	// 最新下发时间 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="this_time")
	private Date thisTime = null;

	// 状态 
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private SyncStockState state = null;


    @Tolerate
	public SyncStock() {
		
	}
    @Tolerate
	public SyncStock(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取门店id
	 */
	public Long getBranchId() {
		return this.branchId;
	}

    /**
     * 设置门店id
     */
	public SyncStock setBranchId(Long branchId) {
		this.branchId = branchId;
		return this;
	}

	/**
	 * 获取门店名称
	 */
	public String getName() {
		return this.name;
	}

    /**
     * 设置门店名称
     */
	public SyncStock setName(String name) {
		this.name = name;
		return this;
	}

	/**
	 * 获取上次下发时间
	 */
	public Date getLastTime() {
		return this.lastTime;
	}

    /**
     * 设置上次下发时间
     */
	public SyncStock setLastTime(Date lastTime) {
		this.lastTime = lastTime;
		return this;
	}

	/**
	 * 获取最新下发时间
	 */
	public Date getThisTime() {
		return this.thisTime;
	}

    /**
     * 设置最新下发时间
     */
	public SyncStock setThisTime(Date thisTime) {
		this.thisTime = thisTime;
		return this;
	}

	public SyncStockState getState() {
		return state;
	}

	public void setState(SyncStockState state) {
		this.state = state;
	}
}
